package com.qf.smsplatform.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

@FeignClient(value = "SMSPLATFORM-CACHE")
public interface CacheClient {


    @GetMapping("/cache/hget/{key}/{field}")
    String hGet(@PathVariable  String key, @PathVariable String field);

    @RequestMapping(value = "/cache/get/{key}", method = RequestMethod.GET)
    String get(@PathVariable("key") String key);

    @RequestMapping(value = "/cache/smembers/{key}", method = RequestMethod.GET)
    Set<Map> smembers(@PathVariable String key);

    @RequestMapping(value = "/cache/smembers/{key}", method = RequestMethod.GET)
    Set<String> smembersString(@PathVariable String key);

    @PostMapping("/cache/hincr/{key}/{field}/{value}")
    Long hincr(@PathVariable String key,@PathVariable String field,@PathVariable long value);
}
